package com.xz.knowledgeDuplication.pattern.decorator;

/**
 * 培根类(具体装饰)
 *
 * @author 召
 * @date 2022-03-12 22:51:38
 */
public class Bacon extends Garnish{

    public Bacon(FastFood fastFood) {
        super(fastFood, 2, "培根");
    }

    @Override
    public float cost() {
        return getPrice() + getFastFood().getPrice();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFastFood().getDesc();
    }
}
